package com.woniu.ly.manageassembly.service.Impl;


import com.woniu.ly.manageassembly.dao.HotelMapper;
import com.woniu.ly.manageassembly.service.HotelService;
import com.woniu.ly.model.model.Hotel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HotelServiceImpl implements HotelService {
    @Autowired
    private HotelMapper hotelMapper;
    @Override
    public int addHotel(Hotel hotel) {
        hotelMapper.insert(hotel);
        return hotel.getHotelId();
    }

    @Override
    public void changeHotel(Hotel hotel) {
        hotelMapper.updateById(hotel);
    }

    @Override
    public Hotel getHotel(int hotelId) {
        return hotelMapper.selectById(hotelId);
    }
}
